home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual Foxpro 6.0 (Ent. Edition) / Vf6ent Extractor.EXE / TOOLS / XSOURCE / XSOURCE.ZIP / vfpsource / Builders / editbldr / editmain.prg < prev   
Encoding:
Text File  |  1998-05-01  |  1.7 KB  |  64 lines

  1. * Program:        EditMain.PRG
  2. * Description:    Main program file for Command Builder
  3. *               Intended to be called from BUILDER.APP, so all environment
  4. *               and other settings should have been made there.
  5. * Version:        .050
  6. * -----------------------------------------------------------------------------------------
  7.  
  8. #DEFINE C_BADCALL1_LOC    "The Edit/Text Box Builder cannot be run as a standalone application. Use BUILDER.APP instead."
  9. #DEFINE C_BADCALL2_LOC    "The proper context for the this Builder has not been established."
  10. #DEFINE C_VCX            "editbldr.vcx"
  11. #DEFINE C_MAIN            "EDITMAIN"
  12.  
  13. PARAMETERS p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p12, p13, p14, p15
  14.  
  15. PRIVATE m.wbReturnValue, m.cParmstring
  16. LOCAL wbi
  17.  
  18. *- make sure we are not called directly
  19. IF PROGRAM(0) == C_MAIN
  20.     *- called directly, so fail
  21.     =MESSAGEBOX(C_BADCALL1_LOC)
  22.     RETURN
  23. ENDIF
  24.  
  25. IF TYPE("wboObject") # 'O'
  26.     *- environment doesn't appear to be set up properly
  27.     =MESSAGEBOX(C_BADCALL2_LOC)
  28.     RETURN
  29. ENDIF
  30.  
  31. RELEASE wboName
  32. PUBLIC wboName
  33.  
  34. m.cParmstring = ""
  35. FOR m.wbi = 1 to PARAMETERS()
  36.     m.thisp = "p" + LTRIM(STR(m.wbi))
  37.     m.cParmstring = m.cParmstring + IIF(!EMPTY(cParmString),",","") + m.thisp    && will create ...,p1,p2,..." etc
  38. ENDFOR
  39.  
  40. SELECT (wboObject.wbaEnvir[5])
  41.  
  42. m.wbReturnValue = wboObject.wbReturnValue
  43.  
  44. SET CLASSLIB TO C_VCX ADDITIVE
  45.  
  46. wboName = CREATEOBJ(wboObject.wbcBldrClass, &cParmstring)        && all builders and wizards are modal formsets
  47.  
  48. IF TYPE("_TIMING") <> "U" AND _TIMING
  49.     RETURN
  50. ENDIF
  51.  
  52. IF TYPE("wboName") = "O"
  53.     wboName.SHOW
  54. ENDIF
  55.  
  56. wboObject.wbReturnValue = m.wbReturnValue
  57.  
  58. IF wboObject.wblModal                            && don't release, if modeless for testing
  59.     RELEASE wboName
  60.     IF FILE(C_VCX)
  61.         RELEASE CLASSLIB C_VCX
  62.     ENDIF
  63. ENDIF
  64.